﻿using GolSig.Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Test.GolSig.Library.GridPositionSpecs
{
    
    
    /// <summary>
    ///This is a test class for GridPositionTest and is intended
    ///to contain all GridPositionTest Unit Tests
    ///</summary>
    [TestClass()]
    public class WhenCreatingGridPosition
    {

        [TestMethod() ]
        public void GivenValidPosition_shouldRecalucateGridPosition()
        {
            Position position = new Position(0, 0);
            GridPosition gridPosition = new GridPosition(position);
            Assert.IsTrue(gridPosition.Row == position.Row + 1);
            Assert.IsTrue(gridPosition.Column == position.Column + 1);
        }

        [TestMethod(), ExpectedException(typeof(System.ArgumentNullException))]
        public void GivenNullPosition_shouldRaiseException()
        {
            Position position =null;
            GridPosition gridPosition = new GridPosition(position);
            Assert.Fail("Expected fexception");
        }
    }


  
}
